package com.netease.financial.domain.interactor;

import com.netease.financial.domain.Factory;
import com.netease.financial.domain.executor.PostExecutionThread;
import com.netease.financial.domain.executor.ThreadExecutor;
import com.netease.financial.domain.repository.NfsRepository;

import rx.Observable;

/**
 * Created by wyf on 8/3/15.
 */
public class GetUnreadSiteMessageCount extends UseCase {

    private final NfsRepository mNfsRepository;

    private Factory<String> mAccessToken;

    public GetUnreadSiteMessageCount(Factory<String> accessToken, NfsRepository nfsRepository,
                                     ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread) {
        super(threadExecutor, postExecutionThread);
        mAccessToken = accessToken;
        mNfsRepository = nfsRepository;
    }

    @Override
    public Observable buildUseCaseObservable() {
        return mNfsRepository.getUnreadMessageCount(mAccessToken.get());
    }

}
